﻿@using ShopKart.Common

@{
    MessageTypeEnum messageTypeEnum = ViewBag.MessageType != null ? (MessageTypeEnum)ViewBag.MessageType : MessageTypeEnum.None;
    MvcHtmlString msg = Html.ValidationSummary(true);
}

<style>
    .validation-summary-errors ul { 
        list-style: none;
        margin-left: -40px;
    }
</style>

@Html.Hidden("messageType", messageTypeEnum.ToString())
@Html.Hidden("validationMessage", msg)

@switch (messageTypeEnum)
{
    case MessageTypeEnum.Success:
        {
            <div class="alert alert-success alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
                @msg
            </div>
            break;
        }
    case MessageTypeEnum.Info:
        {
            <div class="alert alert-info alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
                @msg
            </div>
            break;
        }
    case MessageTypeEnum.Warning:
        {
            <div class="alert alert-warning alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
                @msg
            </div>
            break;
        }
    case MessageTypeEnum.Error:
        {
            <div class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
                @msg
            </div>
            break;
        }
    default:
        {
            break;
        }
}

@Html.AntiForgeryToken()